package com.nlx.notes.module.controller.gold;

import com.nlx.notes.module.bean.vo.gold.GoldPriceMetricsVO;
import com.nlx.notes.module.controller.BaseController;
import com.nlx.notes.module.service.gold.GoldDynamicService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RequestMapping(value = "/gold/dynamic")
@RestController
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class GoldDynamicController  {

    final GoldDynamicService goldDynamicService;

    @GetMapping("/v1/price/metrics")
    public GoldPriceMetricsVO getCurrentGoldPriceMetrics() {
        // 业务逻辑
        if(log.isDebugEnabled()){
            log.debug("查询黄金动态价格");
        }
        return goldDynamicService.getCurrentGoldPriceMetrics();
    }

}
